<?php
/* @var $data array of ECalendarViewItem */
/* @var $id int pk of Cliente*/
?>

<div class="view" >

<b>  
<?php 
$data->date->setTimeZone(new DateTimeZone("America/Costa_Rica"));

echo $data->date->format('j'); 

?>
</b>
<br>

<?php 
if($data->isRelevantDate and (date('w',$data->date->getTimestamp()) == '0')): ?>

	<span style="font-size: 80%; color:red;">Cerrado</span> <br/>

<?php 
elseif($data->isRelevantDate and $data->citasAvailable): ?>

<?php 
	echo CHtml::link(
    'Disponibles', 
    array('viewDay', 'id'=>$id,'year'=>$data->date->format('Y'),'month'=>$data->date->format('m'), 'day'=>$data->date->format('j')),
    array('class'=>'citaDisponible')
	);
	?>
	
<br>


<?php	//if its a Saturday then schedule is 8:30am-2:30pm, else is 9am-6pm
	if(date('w',$data->date->getTimestamp()) == '6'):?>
		<span style="font-size: 60%; color:black;">
	<?php
		echo "8:30am-12:30pm";
	else:?>
		<span style="font-size: 75%; color:black;">
	<?php
		echo "9am - 6pm";
	endif;?>
</span>

<br/>
<?php 
elseif($data->isRelevantDate and !$data->citasAvailable): ?>

	<span style="font-size: 80%; color:red;">Agotadas</span> <br/>
<?php 
else:?>

&nbsp
<br>
---

<?php
endif; 
?>

</div>